package com.situ.mall.juc;

import java.util.concurrent.atomic.AtomicInteger;

public class AtomicTest2 {

    static AtomicInteger num = new AtomicInteger(0);
    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println("thread name: " + Thread.currentThread().getName() + ":" + num.incrementAndGet());
                }
            }).start();
        }
    }

}
